package org.infodavid.common.model.impl;

import org.infodavid.common.model.IGenericProperty;

/**
 * The Class GenericPropertyImpl.
 */
public class GenericPropertyImpl extends AbstractBasicDataObjectImpl implements IGenericProperty {

	/** The Constant serialVersionUID. */
	private static final long serialVersionUID = 741133276297377771L;

	/** The name. */
	private String name = null;

	/** The read only. */
	private boolean readOnly = false;

	/** The scope. */
	private String scope = null;

	/** The type. */
	private String type = null;

	/** The value. */
	private String value = null;

	/**
	 * Instantiates a new data.
	 * @throws Exception the exception
	 */
	public GenericPropertyImpl() throws Exception {
		super();
	}

	/*
	 * (non-Javadoc)
	 * @see org.infodavid.common.model.INamed#getName()
	 */
	@Override
	public String getName() {
		return name;
	}

	/*
	 * (non-Javadoc)
	 * @see org.infodavid.common.model.IGenericData#getScope()
	 */
	@Override
	public String getScope() {
		return scope;
	}

	/*
	 * (non-Javadoc)
	 * @see org.infodavid.common.model.IGenericData#getType()
	 */
	@Override
	public String getType() {
		return type;
	}

	/*
	 * (non-Javadoc)
	 * @see org.infodavid.common.model.IGenericData#getValue()
	 */
	@Override
	public String getValue() {
		return value;
	}

	/*
	 * (non-Javadoc)
	 * @see org.infodavid.common.model.IGenericData#isReadOnly()
	 */
	@Override
	public boolean isReadOnly() {
		return readOnly;
	}

	/*
	 * (non-Javadoc)
	 * @see org.infodavid.common.model.INamed#setName(java.lang.String)
	 */
	@Override
	public void setName(final String value) {
		name = value;
	}

	/*
	 * (non-Javadoc)
	 * @see org.infodavid.common.model.IGenericData#setReadOnly(boolean)
	 */
	@Override
	public void setReadOnly(final boolean flag) {
		readOnly = flag;
	}

	/*
	 * (non-Javadoc)
	 * @see org.infodavid.common.model.IGenericData#setScope(java.lang.String)
	 */
	@Override
	public void setScope(final String scope) {
		this.scope = scope;
	}

	/*
	 * (non-Javadoc)
	 * @see org.infodavid.common.model.IGenericData#setType(java.lang.String)
	 */
	@Override
	public void setType(final String value) {
		type = value;
	}

	/*
	 * (non-Javadoc)
	 * @see org.infodavid.common.model.IGenericData#setValue(java.lang.String)
	 */
	@Override
	public void setValue(final String value) {
		this.value = value;
	}

	/*
	 * (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		final StringBuilder builder = new StringBuilder();

		builder.append(super.toString());
		builder.append("[value=");
		builder.append(value);
		builder.append(", name=");
		builder.append(name);
		builder.append(", scope=");
		builder.append(scope);
		builder.append(", type=");
		builder.append(type);
		builder.append(", readOnly=");
		builder.append(readOnly);
		builder.append("]");

		return builder.toString();
	}
}
